package com.yuyou.fn.tms.vo;

import com.yuyou.fn.common.constant.ClassLevelEnum;
import com.yuyou.fn.common.lang.Tuple3;
import com.yuyou.fn.common.util.EnumUtils;
import com.yuyou.fn.educational.entity.CourseTemplate;
import com.yuyou.fn.platform.entity.City;
import com.yuyou.fn.tms.util.PeriodUtils;
import io.swagger.annotations.ApiModelProperty;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by lzh on 2019/1/23.
 */
public class TmsCourseTemplate {

    /* 启用状态 0:未启用 1:已启用, /1启用2 停用*/
    static Map<Integer,Integer> courseTemplateMap=new HashMap<>();
    static {
        courseTemplateMap.put(1,1);
        courseTemplateMap.put(0,2);
    }
    @ApiModelProperty("主键id")
    private Long couTeId ;//主键id

    @ApiModelProperty("年份")
    private String couTeYear ;//年份

    @ApiModelProperty("季节")
    private String SeaName ;//季节

    @ApiModelProperty("学费")
    private BigDecimal couTeClassFee ;//学费

    @ApiModelProperty("资料费")
    private BigDecimal couTeMaterialFee ;//资料费

    @ApiModelProperty("城市Id")
    private Long cityId ;//城市Id

    @ApiModelProperty("城市名")
    private String cityName ;//城市名

    @ApiModelProperty("管理区域id")
    private Long masIds ;//管理区域id

    @ApiModelProperty("管理区域名称")
    private String masNames ;//管理区域名称

    @ApiModelProperty("课程名字")
    private String courseName ;//课程名字

    @ApiModelProperty("1启用 2停用")
    private Integer couTeStatus ;//1启用 2停用

    @ApiModelProperty("创建时间")
    private Date couTeCreateTime ;//创建时间

    @ApiModelProperty("修改时间")
    private Date couTeModifyTime ;//修改时间

    @ApiModelProperty("课程简介")
    private String couTeInfo ;//课程简介

    @ApiModelProperty("学位数")
    private Integer couTeQuota ;//学位数

    @ApiModelProperty("课程大纲")
    private String courseOutline ;//课程大纲

    @ApiModelProperty("产品ID")
    private Long productId ;//产品ID

    @ApiModelProperty("产品名称")
    private String productName ;//产品名称

    @ApiModelProperty("年级ID")
    private Long gradeId ;//年级ID

    @ApiModelProperty("年级名称")
    private String gradeName ;//年级名称

    @ApiModelProperty("科目ID")
    private Long subjectId ;//科目ID

    @ApiModelProperty("科目名称")
    private String subjectName ;//科目名称

    @ApiModelProperty("课程讲数")
    private Integer lectureAmount ;//课程讲数

    @ApiModelProperty("每一讲时长")
    private Integer lectureDuration ;//每一讲时长

    @ApiModelProperty("层级id")
    private Integer gId ;//层级id

    @ApiModelProperty("层级名")
    private String gName ;//层级名

    public TmsCourseTemplate(CourseTemplate courseTemplate, City city){


        this.setCouTeId(courseTemplate.getCourseTemplateId());//主键id
        this.setCouTeYear(courseTemplate.getPeriodName().substring(0,4));//年份
        this.setCouTeClassFee(courseTemplate.getStudyingFee());//学费
        this.setCouTeMaterialFee(courseTemplate.getMaterialFee());//资料费


        this.setMasIds(courseTemplate.getAreaTeamId());//管理区域id
        this.setMasNames(courseTemplate.getAreaTeamName());//管理区域名称




        this.setCouTeId(courseTemplate.getCourseTemplateId());//主键id
        Tuple3<Long, String, String> sea = PeriodUtils.periodName2Sea(courseTemplate.getPeriodName());
        this.setCouTeYear(sea.getSecond());//年份
        this.setSeaName(sea.getThree());//季节
        this.setCouTeClassFee(courseTemplate.getStudyingFee());//学费
        this.setCouTeMaterialFee(courseTemplate.getMaterialFee());//资料费
        if (city!=null){
            this.setCityId(city.getCityId());//城市Id
            this.setCityName("广州");//城市名
        }
        this.setMasIds(courseTemplate.getAreaTeamId());//管理区域id
        this.setMasNames(courseTemplate.getAreaTeamName());//管理区域名称
        this.setCourseName(courseTemplate.getCourseName());//课程名字
        this.setCouTeStatus(courseTemplateMap.get(courseTemplate.getStatus()));//1启用2 停用
        this.setCouTeCreateTime(courseTemplate.getCreateTime());//创建时间
        this.setCouTeModifyTime(courseTemplate.getUpdateTime());//修改时间
        this.setCouTeInfo(courseTemplate.getCourseDescription());//课程简介
        this.setCouTeQuota(courseTemplate.getQuota());//学位数
        this.setCourseOutline(courseTemplate.getCourseOutline());//课程大纲
        this.setProductId(courseTemplate.getProductId());//产品ID
        this.setProductName(courseTemplate.getProductName());//产品名称
        this.setGradeId(courseTemplate.getGradeId());//年级ID
        this.setGradeName(courseTemplate.getGradeName());//年级名称
        this.setSubjectId(courseTemplate.getSubjectId());//科目ID
        this.setSubjectName(courseTemplate.getSubjectName());//科目名称
        this.setLectureAmount(courseTemplate.getLectureAmount());//课程讲数
        this.setLectureDuration(courseTemplate.getLectureDuration());//每一讲时长
        this.setgId(courseTemplate.getLevel());//层级id
        this.setgName(EnumUtils.getName(ClassLevelEnum.values(),courseTemplate.getLevel()));//层级名
   }

    public Long getCouTeId() {
        return couTeId;
    }

    public void setCouTeId(Long couTeId) {
        this.couTeId = couTeId;
    }

    public String getCouTeYear() {
        return couTeYear;
    }

    public void setCouTeYear(String couTeYear) {
        this.couTeYear = couTeYear;
    }

    public String getSeaName() {
        return SeaName;
    }

    public void setSeaName(String seaName) {
        SeaName = seaName;
    }

    public BigDecimal getCouTeClassFee() {
        return couTeClassFee;
    }

    public void setCouTeClassFee(BigDecimal couTeClassFee) {
        this.couTeClassFee = couTeClassFee;
    }

    public BigDecimal getCouTeMaterialFee() {
        return couTeMaterialFee;
    }

    public void setCouTeMaterialFee(BigDecimal couTeMaterialFee) {
        this.couTeMaterialFee = couTeMaterialFee;
    }

    public Long getCityId() {
        return cityId;
    }

    public void setCityId(Long cityId) {
        this.cityId = cityId;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public Long getMasIds() {
        return masIds;
    }

    public void setMasIds(Long masIds) {
        this.masIds = masIds;
    }

    public String getMasNames() {
        return masNames;
    }

    public void setMasNames(String masNames) {
        this.masNames = masNames;
    }

    public String getCourseName() {
        return courseName;
    }

    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }

    public Integer getCouTeStatus() {
        return couTeStatus;
    }

    public void setCouTeStatus(Integer couTeStatus) {
        this.couTeStatus = couTeStatus;
    }

    public Date getCouTeCreateTime() {
        return couTeCreateTime;
    }

    public void setCouTeCreateTime(Date couTeCreateTime) {
        this.couTeCreateTime = couTeCreateTime;
    }

    public Date getCouTeModifyTime() {
        return couTeModifyTime;
    }

    public void setCouTeModifyTime(Date couTeModifyTime) {
        this.couTeModifyTime = couTeModifyTime;
    }

    public String getCouTeInfo() {
        return couTeInfo;
    }

    public void setCouTeInfo(String couTeInfo) {
        this.couTeInfo = couTeInfo;
    }

    public Integer getCouTeQuota() {
        return couTeQuota;
    }

    public void setCouTeQuota(Integer couTeQuota) {
        this.couTeQuota = couTeQuota;
    }

    public String getCourseOutline() {
        return courseOutline;
    }

    public void setCourseOutline(String courseOutline) {
        this.courseOutline = courseOutline;
    }

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public Long getGradeId() {
        return gradeId;
    }

    public void setGradeId(Long gradeId) {
        this.gradeId = gradeId;
    }

    public String getGradeName() {
        return gradeName;
    }

    public void setGradeName(String gradeName) {
        this.gradeName = gradeName;
    }

    public Long getSubjectId() {
        return subjectId;
    }

    public void setSubjectId(Long subjectId) {
        this.subjectId = subjectId;
    }

    public String getSubjectName() {
        return subjectName;
    }

    public void setSubjectName(String subjectName) {
        this.subjectName = subjectName;
    }

    public Integer getLectureAmount() {
        return lectureAmount;
    }

    public void setLectureAmount(Integer lectureAmount) {
        this.lectureAmount = lectureAmount;
    }

    public Integer getLectureDuration() {
        return lectureDuration;
    }

    public void setLectureDuration(Integer lectureDuration) {
        this.lectureDuration = lectureDuration;
    }

    public Integer getgId() {
        return gId;
    }

    public void setgId(Integer gId) {
        this.gId = gId;
    }

    public String getgName() {
        return gName;
    }

    public void setgName(String gName) {
        this.gName = gName;
    }
}
